//
//  XYTStatementView.m
//  XYTPayOrderSystem
//
//  Created by wupeng on 2017/8/28.
//  Copyright © 2017年 wupeng. All rights reserved.
//

#import "XYTStatementView.h"

@implementation XYTStatementView

-(instancetype)initWithFrame:(CGRect)frame{
    if (self = [super initWithFrame:frame]) {
        
        [self setupUI];
    }
    return self;
}

- (void)setupUI{
    //设置边框和阴影
    UIView *topLine = [[UIView alloc] initWithFrame:CGRectMake(1, 0, boundsWidth-1, 1)];
    topLine.backgroundColor = [UIColor colorWithRed:220.0f/255.0 green:220.0f/255.0 blue:220.0f/255.0 alpha:1];
    topLine.alpha = 0.5;
    topLine.layer.shadowColor = [UIColor blackColor].CGColor;//设置阴影的颜色
    topLine.layer.shadowOpacity = 0.6;
    topLine.layer.shadowOffset = CGSizeMake(0, -0.5);//设置阴影的偏移量
    [self addSubview:topLine];
    
    UIView *bottomLine = [[UIView alloc] initWithFrame:CGRectMake(1, boundsHeight-1, boundsWidth-1, 1)];
    bottomLine.backgroundColor = [UIColor colorWithRed:220.0f/255.0 green:220.0f/255.0 blue:220.0f/255.0 alpha:1];
    bottomLine.alpha = 0.5;
    bottomLine.layer.shadowColor = [UIColor blackColor].CGColor;//设置阴影的颜色
    bottomLine.layer.shadowOpacity = 0.6;
    bottomLine.layer.shadowOffset = CGSizeMake(0, 0.5);//设置阴影的偏移量
    [self addSubview:bottomLine];
    
    UIView *leftLine = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 1, boundsHeight)];
    leftLine.backgroundColor = [UIColor colorWithRed:220.0f/255.0 green:220.0f/255.0 blue:220.0f/255.0 alpha:1];
    leftLine.alpha = 0.5;
    leftLine.layer.shadowColor = [UIColor blackColor].CGColor;//设置阴影的颜色
    leftLine.layer.shadowOpacity = 0.6;
    leftLine.layer.shadowOffset = CGSizeMake(-0.5, 0);//设置阴影的偏移量
    [self addSubview:leftLine];
    
    UIView *rightLine = [[UIView alloc] initWithFrame:CGRectMake(boundsWidth-1, 0, 1, boundsHeight)];
    rightLine.backgroundColor = [UIColor colorWithRed:220.0f/255.0 green:220.0f/255.0 blue:220.0f/255.0 alpha:1];
    rightLine.alpha = 0.5;
    rightLine.layer.shadowColor = [UIColor blackColor].CGColor;//设置阴影的颜色
    rightLine.layer.shadowOpacity = 0.6;
    rightLine.layer.shadowOffset = CGSizeMake(0.5, 0);//设置阴影的偏移量
    [self addSubview:rightLine];
    
    UIImageView *imgView = [[UIImageView alloc] initWithFrame:CGRectMake(15, 15, 65, 65)];
    [self addSubview:imgView];
    self.imgView = imgView;
    
    UILabel *titleLab = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(imgView.frame)+10, 18, 150, 18)];
    titleLab.textColor = [UIColor colorWithRed:69.0f/255.0 green:140.0f/255.0 blue:200.0f/255.0 alpha:1];
    titleLab.font = [UIFont systemFontOfSize:14];
    [self addSubview:titleLab];
    self.titleLab = titleLab;
    
    UILabel *dataLab = [[UILabel alloc] initWithFrame:CGRectMake(CGRectGetMaxX(imgView.frame)+10, CGRectGetMaxY(titleLab.frame)+8, boundsWidth -65-15-10 , 28)];
    dataLab.textColor = [UIColor redColor];
    dataLab.font = [UIFont boldSystemFontOfSize:25.0];
    [self addSubview:dataLab];
    self.dateLab = dataLab;
    
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
